package org.nlp2rdf.navigator.client.util;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.user.client.ui.Widget;

/**
 * apply zebra layout
 * 
 * @author Sebastian Hellmann <hellmann@informatik.uni-leipzig.de>
 * 
 */
public class ZebraLayouter {

	private List<Widget> widgets = new ArrayList<Widget>();

	/**
	 * applies the zebra style to every second widget added
	 * 
	 * @param container
	 */
	public void addWidget(Widget w) {
		if (widgets.size() % 2 == 0) {
			w.setStyleName("zebra");
		}
		widgets.add(w);
	}

}
